package com.cr.mrapp.result;

public class R {
    public static ResponseData ok(Object data){
        ResponseData responseData = new ResponseData();
        responseData.setCode(200);
        responseData.setMsg("操作成功");
        responseData.setData(data);
        return responseData;
    }
    public static ResponseData ok(Object data,String msg){
        ResponseData responseData = new ResponseData();
        responseData.setCode(200);
        responseData.setMsg(msg);
        responseData.setData(data);
        return responseData;
    }
    public static ResponseData fail(Object data){
        ResponseData responseData = new ResponseData();
        responseData.setCode(500);
        responseData.setMsg("操作失败");
        responseData.setData(null);
        return responseData;
    }
    public static ResponseData fail(Object data,String msg){
        ResponseData responseData = new ResponseData();
        responseData.setCode(500);
        responseData.setMsg(msg);
        responseData.setData(null);
        return responseData;
    }
}
